export default {
  TOGGLE_LOADING (state) {
    state.callingAPI = !state.callingAPI
  },
  TOGGLE_SEARCHING (state) {
    state.searching = (state.searching === '') ? 'loading' : ''
  },
  SET_USER (state, user) {
    state.user = user
  },
  SET_TOKEN (state, token) {
    state.token = token
  },
  SET_GRAPH(state,graph){
    state.graph = graph
  },
  SET_HANDLE(state,handle){
    state.handle = handle
  },
  SET_SUBMIT(state,submit){
    state.submit = submit
  },
  SET_ROLES(state,roles){
    state.roles = roles
  },
  SET_APPROVERS(state,approvers){
    state.approvers = approvers
  },
  SET_DEPARTS(state,departs){
    state.departments = departs
  },
  SET_SYSCONFIG(state,configs){
    for(var index in configs){
      var configName = configs[index].name.replace(':','_')
      state.sysconfigs[configName] = configs[index].configs
    }
    // state.sysconfigs = configs
    // state.postTypes = configs.postTypes
  }
}
